package com.erpx.api.logisticssync;

import com.erpx.api.WdtClient;
import com.erpx.api.param.LogisticsSynAckParam;
import com.erpx.utils.JsonUtils;
import com.erpx.api.CommonConstants;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class LogisticsSynAckService {
    public static void logisticSynAck() throws Exception {
        WdtClient client = new WdtClient(CommonConstants.sid, CommonConstants.appkey, CommonConstants.appSecret, CommonConstants.baseUrl);

        Map<String, String> params = new HashMap<String, String>();
        params.put("limit", "1000");

        List<LogisticsSynAckParam> list = new ArrayList<>();
        LogisticsSynAckParam logisticsSynAckParam = new LogisticsSynAckParam();
        logisticsSynAckParam.setRecId(1L);
        logisticsSynAckParam.setStatus(1);
        logisticsSynAckParam.setMessage("");
        list.add(logisticsSynAckParam);

        params.put("logistics_list", JsonUtils.serialize(list));
        //店铺编号
        params.put("shop_id", "7");
        try {
            String response = client.execute("logistics_sync_ack.php", params);
            System.out.println(response);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
